/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CarddKped extends BasicModel<CarddKped> {
  kpedKpdw?: string; // 开票单位
  kpedKpnd?: string; // 开票年度
  kpedKplx?: string; // 开票类型
  kpedKpyj?: number; // 开票月季
  kpedYf?: number; // 月份
  kpedJe?: number; // 金额
  kpedYkje?: number; // 已开金额
  kpedSyje?: number; // 剩余金额
  kpedSe?: number; // 税额
}

export const carddKpedList = (params?: CarddKped | any) =>
  defHttp.get<CarddKped>({ url: adminPath + '/cardd/kped/carddKped/list', params });

export const carddKpedListData = (params?: CarddKped | any) =>
  defHttp.post<Page<CarddKped>>({ url: adminPath + '/cardd/kped/carddKped/listData', params });

export const carddKpedForm = (params?: CarddKped | any) =>
  defHttp.get<CarddKped>({ url: adminPath + '/cardd/kped/carddKped/form', params });

export const carddKpedSave = (params?: any, data?: CarddKped | any) =>
  defHttp.postJson<CarddKped>({ url: adminPath + '/cardd/kped/carddKped/save', params, data });

export const carddKpedImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/kped/carddKped/importData',
      onUploadProgress,
    },
    params,
  );

export const carddKpedDisable = (params?: CarddKped | any) =>
  defHttp.get<CarddKped>({ url: adminPath + '/cardd/kped/carddKped/disable', params });

export const carddKpedEnable = (params?: CarddKped | any) =>
  defHttp.get<CarddKped>({ url: adminPath + '/cardd/kped/carddKped/enable', params });

export const carddKpedDelete = (params?: CarddKped | any) =>
  defHttp.get<CarddKped>({ url: adminPath + '/cardd/kped/carddKped/delete', params });
